levels = {}

function levels.register_basic(name, desc, sound, vol) --Registers node, stairs, slabs. With same texture on all sides.
   vol = vol or 1
   minetest.register_node('levels:'..name, {
      description = desc,
      tiles = {{name='levels_'..name..'.png', align_style='world', scale=4}},
      inventory_image = '[inventorycube{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1',
      groups = {breakable=1},
      sounds = {footstep = {name = sound, gain = vol}}
   })

   stairs.register_stair_and_slab(name,
      {breakable=1},
      {{name='levels_'..name..'.png', align_style='world', scale=4}},
      {footstep = {name = sound, gain = vol}},
      true)
end

function levels.register_tube(name, desc, sound, vol) --Registers node, stairs, slabs. With same texture on all sides.
   vol = vol or 1
   minetest.register_node('levels:'..name, {
      description = desc,
      tiles = {'levels_'..name..'_top.png', 'levels_'..name..'_top.png', 'levels_'..name..'_side.png'},
      groups = {breakable=1},
      sounds = {footstep = {name = sound, gain = vol}},
      paramtype2 = 'facedir',
      on_place = minetest.rotate_and_place,
   })

   stairs.register_stair_and_slab(name,
      {breakable=1},
      {'levels_'..name..'_top.png', 'levels_'..name..'_top.png', 'levels_'..name..'_side.png'},
      {footstep = {name = sound, gain = vol}},
      true)
end

function levels.register_alpha(name, desc, sound, vol) --Registers node, stairs, slabs. With same texture on all sides.
   vol = vol or 1
   minetest.register_node('levels:'..name, {
      description = desc,
      drawtype = 'allfaces',
      paramtype = 'light',
      tiles = {{name='levels_'..name..'.png', align_style='world', scale=4}},
      inventory_image = '[inventorycube{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1{levels_'..name..'.png&[sheet:4x4:1,1',
      groups = {breakable=1},
      sounds = {footstep = {name = sound, gain = vol}},
      paramtype2 = 'facedir',
      on_place = minetest.rotate_and_place,
   })


end

dofile(minetest.get_modpath('levels')..'/ducts.lua')
dofile(minetest.get_modpath('levels')..'/ground.lua')
dofile(minetest.get_modpath('levels')..'/metal.lua')
dofile(minetest.get_modpath('levels')..'/scifi.lua')
dofile(minetest.get_modpath('levels')..'/stone.lua')
dofile(minetest.get_modpath('levels')..'/wood.lua')
